//
//  PicInfo.swift
//
//  Created by 邱仙凯 on 2022/4/8
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct PicInfo: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let zStaffNm = "z_staff_nm"
    static let idKey = "id_key"
    static let zType = "z_type"
    static let zPicUrl = "z_pic_url"
    static let zName = "z_name"
    static let zVouid = "z_vouid"
    static let zMain = "z_main"
    static let zCreateTm = "z_create_tm"
    static let zStaffId = "z_staff_id"
  }

  // MARK: Properties
  public var zStaffNm: String?
  public var idKey: Int?
  public var zType: String?
  public var zPicUrl: String?
  public var zName: String?
  public var zVouid: Int?
  public var zMain: String?
  public var zCreateTm: String?
  public var zStaffId: Int?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    zStaffNm <- map[SerializationKeys.zStaffNm]
    idKey <- map[SerializationKeys.idKey]
    zType <- map[SerializationKeys.zType]
    zPicUrl <- map[SerializationKeys.zPicUrl]
    zName <- map[SerializationKeys.zName]
    zVouid <- map[SerializationKeys.zVouid]
    zMain <- map[SerializationKeys.zMain]
    zCreateTm <- map[SerializationKeys.zCreateTm]
    zStaffId <- map[SerializationKeys.zStaffId]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = zStaffNm { dictionary[SerializationKeys.zStaffNm] = value }
    if let value = idKey { dictionary[SerializationKeys.idKey] = value }
    if let value = zType { dictionary[SerializationKeys.zType] = value }
    if let value = zPicUrl { dictionary[SerializationKeys.zPicUrl] = value }
    if let value = zName { dictionary[SerializationKeys.zName] = value }
    if let value = zVouid { dictionary[SerializationKeys.zVouid] = value }
    if let value = zMain { dictionary[SerializationKeys.zMain] = value }
    if let value = zCreateTm { dictionary[SerializationKeys.zCreateTm] = value }
    if let value = zStaffId { dictionary[SerializationKeys.zStaffId] = value }
    return dictionary
  }

}
